using System;
using System.Collections;
using Server.Items;

namespace Server.Mobiles
{
	public class SBRestockableVendor : SBInfo
	{
		private ArrayList m_BuyInfo;
		private IShopSellInfo m_SellInfo = new InternalSellInfo();

		private RestockableVendor m_vendor;

		public SBRestockableVendor( RestockableVendor vendor )
		{
			m_vendor = vendor;
			m_BuyInfo = new InternalBuyInfo( m_vendor );
		}

		public override IShopSellInfo SellInfo { get { return m_SellInfo; } }
		public override ArrayList BuyInfo { get { return m_BuyInfo; } }

		public class InternalBuyInfo : ArrayList
		{
			public InternalBuyInfo( RestockableVendor rs )
			{
				if ( rs.ExternalBuyInfo != null && rs.ExternalBuyInfo.Count > 0 )
				{
					foreach ( GenericBuyInfo gbi in rs.ExternalBuyInfo )
					{
						if ( gbi.Price > 0 )
							Add( new GenericBuyInfo( (Type)gbi.Type, gbi.Price, gbi.Amount, gbi.ItemID, gbi.Hue ) );
					}
				}
			}
		}

		public class InternalSellInfo : GenericSellInfo
		{
			public InternalSellInfo()
			{
			}
		}
	}
}